/*
 * @Author: Wushiqi
 * @Descripttion: 获取数据字典表的数据
 * @Date: 2020-09-28 14:20:03
 * @LastEditor: Wushiqi
 * @LastEditTime: 2020-09-28 17:04:54
 */
import Vue from 'vue'
import publicAPI from '@/utils/api/public/public'

export async function getDictData(params) {
  const response = await publicAPI.getDictListByType(params)
  let res = []
  try {
    if (response.data.flag === 'success') {
      res = response.data.data
    } else {
      Vue.prototype.$errorMsg(response.data.data)
    }
  } catch (error) {
    Vue.prototype.$errorMsg('' + error)
  }
  return res
}
